/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.graphic.objects.addons;

import model.graphic.objects.addons.Addon;
import java.awt.geom.Line2D;
import model.graphic.locations.Location;

/**
 *
 * @author Jelle
 */
public class ZoomAddon extends Addon {

    private Line2D.Double l3;

    public ZoomAddon() {
        l3 = new Line2D.Double();
    }

    @Override
    public boolean inAddon(int x, int y) {
        return (x > l1.getX1() - 3 && x < l1.getX2() + 3 && y > l1.getY2() - 3 && y < l1.getY1() + 3);
    }

    /**
     * @param center the center to set
     */
    public void setCenter(Location center) {
        this.center = center;
        l1 = new Line2D.Double(center.getX() - 12, center.getY() + 12, center.getX() - 6, center.getY() + 6);
       /* if (isCollapsed()) {
            l2 = new Line2D.Double(center.getX() - 10, center.getY() + 6, center.getX() - 6, center.getY() + 6);
            l3 = new Line2D.Double(center.getX() - 6, center.getY() + 6, center.getX() - 6, center.getY() + 10);
        } else {*/
            l2 = new Line2D.Double(center.getX() - 12, center.getY() + 6, center.getX() - 12, center.getY() + 12);
            l3 = new Line2D.Double(center.getX() - 12, center.getY() + 12, center.getX() - 6, center.getY() + 12);
        //}
    }

    /**
     * @return the l3
     */
    public Line2D.Double getL3() {
        return l3;
    }
}
